<?php

// set flag to tell our apps that this is a parent file
define('IN_APPS', 1);

// set shortform for DIRECTORY_SEPARATOR
define('DS', DIRECTORY_SEPARATOR);

// set base path for our apps
define('BASE_PATH', dirname(__FILE__));

// set controller path
define('CONTROLLER_PATH', BASE_PATH . DS . 'controllers');

// set model path
define('MODEL_PATH', BASE_PATH . DS . 'models');

// set view path
define('VIEW_PATH', BASE_PATH . DS . 'views');

// set includes path
define('INCLUDE_PATH', BASE_PATH . DS . 'includes');

// set libraries path
define('LIBRARY_PATH', BASE_PATH . DS . 'libraries');

// load our configuration file
require_once BASE_PATH . DS . 'config.php';

// load some functions
require_once BASE_PATH . DS . 'includes' . DS . 'functions.php';

// load bootstrap
require_once BASE_PATH . DS . 'includes' . DS . 'bootstrap.php';

session_regenerate_id();

// create new controller instance
$obj = new $controller();

// load the action
$obj->$action($params);
